package cn.com.lsy.product.lepao.service.impl;

import cn.com.lsy.product.lepao.model.dao.LpGoodsTblMapper;
import cn.com.lsy.product.lepao.model.entities.LpGoodsTbl;
import cn.com.lsy.product.lepao.model.entities.LpGoodsTblExample;
import cn.com.lsy.product.lepao.service.IGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service

public class GoodsService implements IGoodsService {

    @Autowired
    LpGoodsTblMapper lpGoodsTblMapper;

    @Override
    public LpGoodsTbl selectGoodsInfo(int goodsId) {

        return lpGoodsTblMapper.selectByPrimaryKey(goodsId);
    }

    @Override
    public List<LpGoodsTbl> selectGoodsByType(String type) {

        LpGoodsTblExample example = new LpGoodsTblExample();

        example.createCriteria().andTypeEqualTo(type);

        return lpGoodsTblMapper.selectByExample(example);

    }
}
